#!/bin/bash
# 自动给Public里新增加的文件添加读写属性，window机器访问文件时可以打印
# sudo ln -s ~/vimrc/linux_config/inotifywait.sh /etc/init.d/inotifywait.sh
#
# inotifywait -mrq -e modify,create,delete,attrib,close_write,move ~/Documents/common/PAN-PyTorch/ | while read file
inotifywait -m  -e move ~/Public | 
while read path action file; do
    if [ -f "$path$file" ]; then
        chmod o=rw "$path$file"
        # echo "$path$file"
    fi
done
